package cn.miw.android.bdmp3.model;

import java.io.Serializable;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@SuppressWarnings("serial")
@XStreamAlias("result")
public class Catlogs implements Serializable {
	private int count;
	@XStreamImplicit
	private List<Catlog> catlogs;

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public List<Catlog> getCatlogs() {
		return catlogs;
	}

	public void setCatlogs(List<Catlog> catlogs) {
		this.catlogs = catlogs;
	}

	@Override
	public String toString() {
		return "Catlogs [count=" + count + ", catlogs=" + catlogs + "]";
	}

	@XStreamAlias("data")
	public class Catlog implements Serializable {
		private int id;
		private String name;
		private int tcount;
		private int isnew;

		public int getId() {
			return id < 400 ? id : (id - 400);
		}

		public void setId(int id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public int getTcount() {
			return tcount;
		}

		public void setTcount(int tcount) {
			this.tcount = tcount;
		}

		public int getIsnew() {
			return isnew;
		}

		public void setIsnew(int isnew) {
			this.isnew = isnew;
		}

		public String getTrueURL() {
			return "http://box.zhangmen.baidu.com/x?op=22&listid=" + getId();
		}

		@Override
		public String toString() {
			return "Catlog [id=" + id + ", name=" + name + ", tcount=" + tcount + ", isnew=" + isnew + "]";
		}

	}
}
